<?php
/**
 * 首页数据和公共一些数据
 */
namespace app\index\controller;
use app\common\exception\System as SystemException;
use Exception;

class Home extends Common
{
	/**
     * 不需要登录
     * @var array
     */
    protected $noNeedLogin = ['index'];

    /**
     * @return \think\Response
     * 首页
     */
    public function index()
    {
        $city = trim($this->request->post('city'));
        $landed_cate = trim($this->request->post('landed_cate'));
        $ad = service('index/Landed')->getHomeAd();
        $landed = service('index/Landed')->getMainIndex(1,$city,1,5,$param=[],$landed_cate,$price='',$room='');
        unset($landed['ad']);

        $res['ad']     = $ad;
        $res['landed'] = $landed;

        return $this->successReturn($res, SystemException::E_SUCCESS, '获取成功');
    }

}